<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body,html{
            width: 100%;
            height: 100%;
        }
        #box{
            width: 100%;
            height: 100%;
        }
        #box ul{
            width: 100%;
            height: 100%;
            list-style: none;
            position: relative;
        }
        #box ul li{
            width: 250px;
            height: 360px;
            /*border: 1px solid #000;*/
            position: absolute;
            /*left: 0;*/
            /*top: 0;*/
            background-color: #fff;
            transition: all 1s;
            box-shadow: 0 0 3px #000;
        }
        #box li img{
            width: 250px;
            height: 450px;
        }
        #box ul li.curr{
            transform:rotate(0deg) translate(-50%,-50%)  scale(1.5)  !important;
            /*transform: rotate(90deg) !important;*/

            left: 50% !important;
            top: 50% !important;
            z-index: 998;
        }
        body {
            background-color: palegoldenrod;
        }
    </style>
</head>

<body>
    <div id="box">
        <ul>
            <li><img src="./images/微信图片_20191207170529.jpg" alt=""></li>
            <li><img src="./images/微信图片_201912071705291.jpg" alt=""></li>
            <li><img src="./images/微信图片_201912071705292.jpg" alt=""></li>
            <li><img src="./images/微信图片_201912071705293.jpg" alt=""></li>
            <li><img src="./images/微信图片_201912071705294.jpg" alt=""></li>
            <li><img src="./images/微信图片_201912071705295.jpg" alt=""></li>
            <li><img src="./images/微信图片_201912071705296.jpg" alt=""></li>
            <li><img src="./images/微信图片_201912071705297.jpg" alt=""></li>
            <li><img src="./images/微信图片_201912071705298.jpg" alt=""></li>
            <li><img src="./images/微信图片_201912071705299.jpg" alt=""></li>
        </ul>
    </div>
    <script>

        var box = document.getElementById('box');
        var oul = box.children[0];
        var list = oul.children;

        var screenW = document.documentElement.clientWidth - 250;
        var screenH = document.documentElement.clientHeight - 360;

        for (var index = 0; index < list.length; index++) {
            var ele = list[index];
            var x = getRandom(0, screenW);
            var y = getRandom(0, screenH);

            ele.style.left = x + 'px';
            ele.style.top = y + 'px';

            var angle = getRandom(0, 360);
            ele.style.transform = 'rotate(' + angle + 'deg)';

            ele.onclick = function () {
                for (var i = 0; i < list.length; i++) {
                    list[i].className = '';
                }
                this.className = 'curr';
            }
        }
        function getRandom(min, max) {
            return Math.floor(Math.random() * (max - min + 1) + min);
        }
    </script>
</body>

</html>